package com.xingge.socketio.listener;

import com.corundumstudio.socketio.SocketIOClient;
import com.corundumstudio.socketio.SocketIOServer;
import com.corundumstudio.socketio.listener.DisconnectListener;

import lombok.extern.slf4j.Slf4j;

/**
 * @Title:  AppDisConnectListener.java
 * @Package com.xingge.socketio.listener
 * @Description: 断开连接监听器
 * @author: zhangwei
 * @date:   2022年8月6日
 * @time：	上午1:16:30
 * @version  v1.0
 * @Copyright: 2019 XingGe All rights reserved.
 */
@Slf4j
public class AppDisConnectListener implements DisconnectListener {
	
	private SocketIOServer ioServer;
	
	public AppDisConnectListener(SocketIOServer ioServer){
		this.ioServer = ioServer;
	}

	@Override
	public void onDisconnect(SocketIOClient client) {
		System.err.println(client.getSessionId()+ " Disconnected");
		log.info("{} 断开连接", client.getSessionId(), client.getRemoteAddress());
	}

}
